import request from '@/utils/request'

// 发起缴费
export function startCharge(query) {
  return request({
    url: '/community/cost/start',
    method: 'get',
    params: query
  })
}

// 结束 通过 costId 结束
export function stopCharge(costId) {
  return request({
    url: '/community/cost/stop/' + costId,
    method: 'get'
  })
}

// 查询缴费设置列表
export function listCost(query) {
  return request({
    url: '/community/cost/list',
    method: 'get',
    params: query
  })
}

// 查询缴费设置详细
export function getCost(id) {
  return request({
    url: '/community/cost/' + id,
    method: 'get'
  })
}

// 新增缴费设置
export function addCost(data) {
  return request({
    url: '/community/cost',
    method: 'post',
    data: data
  })
}

// 修改缴费设置
export function updateCost(data) {
  return request({
    url: '/community/cost',
    method: 'put',
    data: data
  })
}

// 删除缴费设置
export function delCost(id) {
  return request({
    url: '/community/cost/' + id,
    method: 'delete'
  })
}

// 导出缴费设置
export function exportCost(query) {
  return request({
    url: '/community/cost/export',
    method: 'get',
    params: query
  })
}
